import Vue from 'vue'
import VueRouter from 'vue-router'
import login from "@/components/login";
import login_success from "@/components/login_success";
import curm_mg from "@/components/students_login/curm_mg";
import Welcome from "@/components/Welcome";
import selectcm from "@/components/students_login/selectcm";
import scores from "@/components/students_login/scores";
import person from "@/components/students_login/person";
import login_success2 from "@/components/login_success2";
import curmmgg from "@/components/teacher_log/curmmgg";
import scEvan from "@/components/teacher_log/scEvan";
Vue.use(VueRouter)

const routes = [
    {path:'/',redirect:'/login'},
    {path: "/login", component:login},
    {path: "/success",
        component:login_success,
        redirect: '/welcome',
        children:[
            { path:'/curmmg',component:curm_mg},
            {path: '/welcome',component: Welcome},
            {path:'/selectcm',component: selectcm},
            {path:'/scores',component: scores},
            {path: '/person',component: person},
        ]
    },
    {
        path: "/success2",
        component:login_success2,
        //redirect: '/welcome1',
        children:[
            { path:'/curmmgg',component:curmmgg},
            {path: '/welcome',component: Welcome},
            {path:'/scEvan',component: scEvan},

        ]
    }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
//挂载路由守卫
/*
router.beforeEach((to,from,next) => {
   if(to.path=='/login') return next()

})*/
export default router
